#!/usr/bin/node

const fs = require('fs'),
      src = process.argv[2],
      dts = process.argv[3];
try{
  let src1 = fs.openSync(src,'r');
  let dts1 = fs.openSync(dts,'w');

  let size = fs.statSync(src).size;

  fs.writeSync(dts1,fs.readFileSync(src1),0,size,0);

  //修改权限
  fs.chmodSync(dts, fs.statSync(src).mode);
  
  fs.closeSync(src1);
  fs.closeSync(dts1);

}catch(e){
  console.error(e.message);
  process.exit(1);
}
